<!DOCTYPE html>
  <html lang="en">
  <head>
      <meta charset="UTF-8" >
      <title>用户登录</title>
  </head>
  <body>
    <form name="myForm">
        <table align="center">
            <caption>您好，欢迎使用WiFi Relay</caption>
            <tr>
                <td>
				<td>
                    <label>用户登录</label>
                </td>
			<tr>
                <td>登录账户：</td>
                <td>
                   <input type="text" name="loginName" />
                </td>
            </tr>
            <tr>
                <td>登录密码：</td>
                <td>
                    <input type="password" name="loginPwd" />
                </td>
            </tr>
            <!-- 以下是提交、取消按钮 -->
            <tr>
                <td colspan="2" style="text-align: center; padding: 5px;">
                    <input type="button" value="提交" onclick="submitFrom()"/>
                    <input type="button" value="重置" onclick="resetFrom()"/>
                </td>
            </tr>
        </table>
    </form>      
  </body>
<script>
    //提交
    function submitFrom()
    {
        //验证数据
        if(!myForm.loginName.value)
        {
            alert("请输入登录账户！");
            myForm.loginName.focus();
            return;
        }
 
        if(!myForm.loginPwd.value)
        {
            alert("请输入登录密码！");
            myForm.loginPwd.focus();
            return;
        }
 
        //提交表单
        myForm.method = 'POST';
        myForm.action = "/verify";
        myForm.submit();
    }
 
    //重置
    function resetFrom()
    {
        //重置表单
        document.getElementsByName("myForm")[0].reset();
    }
</script>  
</html>
